package com.fhh.service;



import com.fhh.dao.DeptDao;
import com.fhh.dao.DeptDaoImpl;
import com.fhh.model.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.context.support.WebApplicationContextUtils;

import java.util.List;
@Service //@Component//组件 id默认是deptServiceImpl
public class DeptServiceImpl implements DeptService {

    @Autowired  //从spring容器中查找deptDao的对象
    private DeptDao deptDao;
//    public void setDeptDao(DeptDao deptDao){
//        this.deptDao =deptDao;
//    }


    public boolean saveDept(Dept dept) {
        return deptDao.saveDept(dept);
    }

    public boolean updateDept(Dept dept) {
        return deptDao.updateDept(dept);
    }

    public boolean deleteDept(int id) {
        return deptDao.deleteDept(id);
    }

    public List<Dept> findByParam(Dept param) {
        return deptDao.findByParam(param);
    }
}
